﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Storage;
using Microsoft.Xna.Framework.GamerServices;

namespace Tunneler {
    public class Controls {
        public PlayerIndex GamepadIndex { get; set; }

        public Keys Up { get; set; }

        public Keys Down { get; set; }

        public Keys Left { get; set; }

        public Keys Right { get; set; }

        public Keys Fire { get; set; }

        public Controls SetGamepadIndex(PlayerIndex gamepadIndex) {
            GamepadIndex = gamepadIndex;
            return this;
        }

        public Controls SetUp(Keys key) {
            Up = key;
            return this;
        }

        public Controls SetDown(Keys key) {
            Down = key;
            return this;
        }

        public Controls SetLeft(Keys key) {
            Left = key;
            return this;
        }

        public Controls SetRight(Keys key) {
            Right = key;
            return this;
        }

        public Controls SetFire(Keys key) {
            Fire = key;
            return this;
        }

        public bool UsedKey(Keys key) {
            return key == Up || key == Down || key == Left || key == Right || key == Fire;
        }
    }
}
